package com.winning.pmph.schedule;

import javax.annotation.Resource;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.winning.pmph.service.IncreaseBookService;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component
@ConditionalOnProperty(prefix = "scheduling", name = "enabled")
public class IncreaseSyncSchedule {
    @Resource
    private IncreaseBookService increaseBookService;

    @Scheduled(cron = "0 0/10 * * * ?") // 每10分钟执行一次
    public void publishExerciseGroup(){
        log.info("启动定时任务, 推送数据到增值系统移动端");
        increaseBookService.syncBookData();
        log.info("启动定时任务, 推送数据到增值系统移动端结束;");
    }
}
